<template>
	<view class="flex-col page">
		<view class="flex-col group_1">
			<view class="flex-col group_2">
				<view class="flex-row">
					<image :src="imgUrl+'16557836458052103381.png'" class="image_2" />
					<text class="text_1">账号注销</text>
				</view>
				<text class="text_2">永久注销且无法恢复，请谨慎操作</text>
			</view>
			<text class="text_3">账号注销后将放弃以下权益：</text>
			<text class="text_4">
				1、账号信息、第三方授权信息将被清空且无法恢复。 2、账号相关信息将会一并被删除且无法恢复。
				3、注销后手机号码可重新注册，所生成账号为全新的 账号，不包含注销账号的任何信息。
			</text>
			<view class="flex-col items-start text-wrapper">
				<text class="text_5">点击下方按钮，即表示你已阅读并了解以上风险</text>
			</view>
			<view class="flex-col group_4">
				<view class="flex-col items-center button" @click="confirm"><text class="text_6">我已清楚风险，确定继续</text>
				</view>
				<view class="flex-col items-center button_1"  @click="back"><text class="text_7">返回</text></view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
imgUrl:this.$IMG_URL,
			};
		},
		methods: {
			back()
			{
			  uni.navigateBack({
				  delta:1
			  })	
			},
			confirm() {
				var logoutType = uni.getStorageSync('logoutType');
				var logoutReason = uni.getStorageSync('reason');
				uni.showModal({
					title: '提示',
					content: '请再次确认，你已了解注销风险, 并要继续执行该操作',
					success: (res) =>{
						if (res.confirm) {
							this.$http('user.logout', {
								logoutType: logoutType,
								logoutReason: logoutReason,
							}).then(r => {
								if (r.code == 200) {
									uni.$u.toast(r.msg);

									uni.removeStorageSync('logoutType');
									uni.removeStorageSync('reason');
									//清空存储
									setTimeout(() => {
										uni.$u.toast(r.msg);
										this.go('/pages/index/my',true);
									}, 1000)


								} else {
									uni.$u.toast(r.msg);
								}

							});
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
			}
		},
	};
</script>

<style scoped lang="scss">
	.page {
		background-color: #ffffffff;
		width: 100%;
		overflow-y: auto;
		overflow-x: hidden;
		height: 100%;
	}

	.group_1 {
		padding: 0 30.5rpx 39rpx 31.5rpx;
		flex: 1 1 auto;
		overflow-y: auto;
	}

	.group_2 {
		padding: 32rpx 0 41rpx;
		border-bottom: solid 1rpx #ededed;
	}

	.text_3 {
		font-weight: 800;
		margin-top: 29rpx;
		align-self: flex-start;
		color: #333333;
		font-size: 32rpx;
		font-family: '.AppleSystemUIFont';
		line-height: 38rpx;
	}

	.text_4 {
		font-weight: 400;
		margin-top: 40rpx;
		color: #333333;
		font-size: 28rpx;
		font-family: '.AppleSystemUIFont';
		line-height: 33rpx;
		text-align: left;
	}

	.text-wrapper {
		margin-top: 74rpx;
		padding-top: 30rpx;
		height: 58rpx;
		border-top: solid 1rpx #ededed;
	}

	.group_4 {
		margin-top: 388rpx;
	}

	.text_2 {
		margin-top: 34rpx;
		align-self: flex-start;
		color: #333333;
		font-size: 28rpx;
		font-family: '.AppleSystemUIFont';
		line-height: 33rpx;
	}

	.text_5 {
		color: #ff371d;
		font-size: 24rpx;
		font-weight: 400;
		font-family: '.AppleSystemUIFont';
		line-height: 28rpx;
	}

	.button {
		padding: 25rpx 0 ;
		background-color: #1d6aff;
		border-radius: 44rpx;
	}

	.button_1 {
		margin-top: 40rpx;
		padding: 26rpx 0;
		border-radius: 44rpx;
		background-image: url('https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/617a2ca7e4f1450011362b37/62b127f6d029820011531bae/16557836462092714380.png');
		background-size: 100% 100%;
		background-repeat: no-repeat;
	}

	.image_2 {
		margin-top: 8rpx;
		width: 34rpx;
		height: 36rpx;
	}

	.text_1 {
		font-weight: 800;
		margin-left: 16rpx;
		margin-bottom: 6rpx;
		color: #333333;
		font-size: 32rpx;
		font-family: '.AppleSystemUIFont';
		line-height: 38rpx;
		letter-spacing: 1.28rpx;
	}

	.text_6 {
		color: #ffffff;
		font-size: 32rpx;
		font-family: '.AppleSystemUIFont';
		line-height: 38rpx;
	}

	.text_7 {
		color: #1d6aff;
		font-size: 32rpx;
		font-family: '.AppleSystemUIFont';
		line-height: 38rpx;
	}
</style>
